<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class Sateupdate extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required|min:3|max:10',
            'keyword' => 'required',
            'desc' => 'required',
            'message' => 'required',
            'record' => 'required',
            'phone' => 'required'
        ];
    }

    public function messages()
    {
      return [
        'name.required' => '网站名不能为空',
        'keyword.required' => '关键词不能为空',
        'desc.required' => '网站描述不能为空',
        'message.required' => '底部版权信息不能为空',
        'record.required' => '备案号不能为空',
        'phone.required' => '电话不能为空',
      ];
    }
}
